package edu.whut.Test;

public class test02 {
    public static void main(String[] args) {
        Coder coder = new Coder("周新琦",25,20000);
        Manager manager = new Manager("陈小乔",62,32000,10000);
        coder.work();
        manager.work();
    }

}
class Employee{
    private String name;
    private int age;
    private double salary;

    public Employee() {
    }

    public Employee(String name, int age, double salary) {
        this.name = name;
        this.age = age;
        this.salary = salary;
    }
    public void work(){
        System.out.println("员工工作！");
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }


    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }
}
class Coder extends Employee{
    public Coder(){
    }
    public Coder(String name,int age,double salary){
        super(name,age,salary);
    }
    @Override
    public void work(){
        System.out.println("姓名为"+super.getName()+",年龄为"+super.getAge()+",工资为"+super.getSalary()+"的程序员正在加班");
    }

}
class Manager extends Employee{
    private double money;

    public Manager() {
    }

    public Manager(String name,int age,double salary,double money) {
        super(name,age,salary);
        this.money = money;
    }
    @Override
    public void work(){
     System.out.println("姓名为"+getName()+",年龄为"+getAge()+",工资为"+super.getSalary()+
             "奖金为"+money+"的项目经理正在干饭");
}
    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }
}